package com.weimob.docker.controller;

import com.weimob.docker.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: xh-learn-record
 * @description:
 * @author: sch
 * @create: 2022-12-09 22:59
 **/
@RestController
@RequestMapping("docker/redis")
public class RedisController {
    @Autowired
    private RedisUtil redisUtil;

    @PostMapping("set")
    public String redisTest(@RequestBody String[] str) {
        redisUtil.set("a", "av");
        redisUtil.set(str[0], str[1]);
        return "已存入";
    }

    @GetMapping("get")
    public Object redisGet(String str) {
        return redisUtil.get(str);
    }
}
